package de.stefanocke.roo.kontaktliste.domain;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.entity.RooJpaEntity;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaEntity
//@RooJpaActiveRecord
public class Kontakt {

	
    @NotNull
    private String vorname;

    @NotNull
    private String nachname;

    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "S-")
    private Date geburtstag;

    private String email;

    @OneToMany(cascade=CascadeType.ALL)    
    private Set<Adresse> adresse = new HashSet<Adresse>();
	
	
}
